const mongoose = require('mongoose');
const Schema = mongoose.Schema;


const UserSchema = new Schema({
    name: {
        type: String,
        trim: true,
        unique: true,
        index: true
    },
    password: String,
    create_time: {
        type: Date,
        default: Date.now
    },
    last_login_time: {
        type: Date,
        default: Date.now
    },
    avatar: String,
    desc: String,
    online: {
        type: Boolean,
        default: false
    }
    
});

const User = mongoose.model('User', UserSchema);

module.exports = User;